<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>算术运算符</title>
	<script>
	/*
		// + 运算符
		var a,b,c;
		a = 1;
		b = 2;
		c = a + b;
		console.log(c);
	*/
		
		var a = 2,b = 3,c  = a+b;
		console.log(c);
		
	/*
		// - 运算符
		var a,b,c;
		a = 10;
		b = 5;
		c = a - b;
		console.log(c);
	*/
		console.log(b - a);
		
	/*
		// * 运算符
		var a,b,c;
		a = 3;
		b = 5;
		c = a * b;
		console.log(c);
	*/
		console.log(a *b);
	/*
		// / 运算符
		var a,b,c;
		a = 5;
		b = 2;
		c = a/b;
		console.log(c):
	*/
		console.log(a / b);
	/*
		// % 运算符
		var a,b,c;
		a = 8;
		b = 3;
		c = a%b;
		console.log(c);
	*/
		console.log(b % a);

		
		// ++ 前自增运算符
		var a,b;
		a = 1;
		b = ++a;
		console.log(b);

		// -- 前自减运算符
		var c,d;
		c = 2;
		d = --c;
		console.log(d);

		// ++ 后自增运算符
		var a2,b2;
		a2 = 3;
		b2 = a2++;
		console.log(b2 );
		console.log(a2++);
		console.log(a2--);

		// -- 后自减运算符
		var c2,d2;
		c2 = 2;
		d2 = c2--; 
		console.log(d2);


	
		// 综合训练 ++ --
		var x1,y2,x2,y2,m;
		x1 = 2;
		y2 = 4;
		x2 = 6;
		y2 = 8;
		m = (++x1) + (y2++) + (--x2) + (y2--);
		console.log(m);   // m = ?
	

	
	</script>
</head>
<body>
	
</body>
</html>